# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=man-pages
pkgver=5.13
pkgrel=1
pkgdesc="Linux man pages"
url="https://www.kernel.org/doc/man-pages/"
arch="noarch"
license="GPL-2.0-or-later"
options="!strip !check"
makedepends="coreutils"
source="https://cdn.kernel.org/pub/linux/docs/man-pages/man-pages-$pkgver.tar.xz"

package() {
	make prefix="$pkgdir"/usr install
	find "$pkgdir"/usr/share/man -name "*.[0-9]" -o -name "*.[0-9]" \
		| xargs gzip -9

	# provided by libiconv-doc
	rm -f "$pkgdir"/usr/share/man/man3/iconv*

	# provided by mandoc
	rm -f "$pkgdir"/usr/share/man/man7/man* \
		"$pkgdir"/usr/share/man/man7/mdoc*

	# provided by tzdata
	rm -f "$pkgdir"/usr/share/man/man5/tzfile* \
		"$pkgdir"/usr/share/man/man8/tzselect* \
		"$pkgdir"/usr/share/man/man8/zic* \
		"$pkgdir"/usr/share/man/man8/zdump*

	# provided by libbsd
	rm -f "$pkgdir"/usr/share/man/man3/explicit_bzero*
}

sha512sums="
a68c0bd5f078aff2f13f962060863e5d30734c1c562e8e9e3d5eda5a329b18ad3e9b4ebb883d31cacfc0a476f91fccb8dd4257598acd75d09dd21351893d3499  man-pages-5.13.tar.xz
"
